package com.imooc.api.controller.article;

import com.imooc.grance.result.GraceJsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;

/**
 * Created with IntelliJ IDEA.
 *
 * @auther Levi
 * @Date: 2021/03/18/17:16
 * @Description:
 */
@Api(tags = "文章服务的Controller",value = "文章服务的Controller")
@RequestMapping("portal/article")
public interface ArticlePortalControllerApi {

    @ApiOperation(value = "门户端查询文章列表",notes = "门户端查询文章列表",httpMethod = "GET")
    @GetMapping("list")
    public GraceJsonResult articleList(@RequestParam Integer category,
                                       @RequestParam @ApiParam(value = "要查看的页数") Integer page,
                                       @RequestParam @ApiParam(value = "一页显示几条数据") Integer pageSize,
                                       @RequestParam String keyword) ;

    @ApiOperation(value = "门户端最新热文文章列表",notes = "门户端最新热文文章列表",httpMethod = "GET")
    @GetMapping("hotList")
    public GraceJsonResult hotList();

    @ApiOperation(value = "作家主页文章列表",notes = "作家主页文章列表",httpMethod = "GET")
    @GetMapping("queryArticleListOfWriter")
    public GraceJsonResult queryArticleListOfWriter(@RequestParam @ApiParam(value = "要查看的页数") Integer page,
                                       @RequestParam @ApiParam(value = "一页显示几条数据") Integer pageSize,
                                       @RequestParam String writerId) ;

    @ApiOperation(value = "作家主页近期佳文",notes = "作家主页近期佳文",httpMethod = "GET")
    @GetMapping("queryGoodArticleListOfWriter")
    public GraceJsonResult hotList(String writerId);

    @ApiOperation(value = "文章详情展示",notes = "文章详情展示",httpMethod = "GET")
    @GetMapping("detail")
    public GraceJsonResult detail(@RequestParam String articleId);

    @ApiOperation(value = "文章阅读量累加",notes = "文章阅读量累加",httpMethod = "POST")
    @PostMapping("readArticle")
    public GraceJsonResult readArticle(@RequestParam String articleId,HttpServletRequest request);


    @ApiOperation(value = "获取文章的阅读数",notes = "获取文章的阅读数",httpMethod = "GET")
    @GetMapping("readCounts")
    public Integer readCounts(@RequestParam String articleId) ;

}
